import { watcher } from "@feng3d/watcher";
import { reactive } from "@vue/reactivity";

// 直接访问属性

const a = { a: 1 };
const r_a = reactive(a)
// const r_a = new Proxy(a,{})
// const r_a = { a: 1 };

const o = { a: 1 };
watcher.on().watchchain(o, "a", () => { })
    // .off()
    ;

const count = 10000000;

console.time("reactive");
for (let i = 0; i < count; i++) {
    r_a.a;
}
console.timeEnd("reactive")
r_a.a;
console.time("watch");
for (let i = 0; i < count; i++) {
    o.a;
}
console.timeEnd("watch");
console.time("reactive");
for (let i = 0; i < count; i++) {
    r_a.a;
}
console.timeEnd("reactive")
r_a.a;
console.time("watch");
for (let i = 0; i < count; i++) {
    o.a;
}
console.timeEnd("watch");